#include <iostream> 
#include <set>
#include <algorithm>
#include <cctype>

using namespace std; 

int main (){

	set <string> words; 
	  set<string>::iterator it;
	cout << "Introduce palabras ('fin' para acabar)"<<endl; 
	string aux; 
	do
	{
		cin>> aux; 
		words.insert(aux);

	}while (aux != "fin");
	words.erase (words.find("fin"));
	for (it=words.begin(); it!=words.end(); ++it)
		
 	  cout << " " << *it;

 	return 0;
}
